function debounce(callback, delay) {
  var timerId = null; //定时器id
  return function () {
    clearTimeout(timerId);
    timerId = setTimeout(() => {
      var curThis = this;
      callback.apply(curThis, arguments);
    }, delay);
  };
}
